14. Espresso Write Your Own Test

Now it's time to write an Espresso test yourself.

Step 1: Write an Espresso

  1. Create a new test called completedTaskDetails_DisplayedInUi and copy over this skeleton code:

TaskDetailFragmentTest.kt

    @Test
    fun completedTaskDetails_DisplayedInUi() = runBlockingTest{
        // GIVEN - Add completed task to the DB

        // WHEN - Details fragment launched to display task

        // THEN - Task details are displayed on the screen
        // make sure that the title/description are both shown and correct
}
  1. Looking at the previous test, complete this test.
  2. Run and confirm the test passes.